#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> pii; 

void solve() {
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    ll ans = k, pre = 0;
    for(int i = 0; i < n && k > 0; i++) {
        k -= (a[i] - pre) * (n - i);
        pre = a[i];
        if(k > 0) ans++;
        else break;
    }
    cout << ans << endl;
}

int main() {
    int t;
    cin >> t;
    while(t--) solve();
    return 0;
}
